import request from '@/utils/request'

// 查询设备点检列表
export function listDeviceCheck(query) {
  return request({
    url: '/device/deviceCheck/list',
    method: 'get',
    params: query
  })
}

// 查询设备点检详细
export function getDeviceCheck(djmId) {
  return request({
    url: '/device/deviceCheck/' + djmId,
    method: 'get'
  })
}

// 新增设备点检
export function addDeviceCheck(data) {
  return request({
    url: '/device/deviceCheck',
    method: 'post',
    data: data
  })
}

// 修改设备点检
export function updateDeviceCheck(data) {
  return request({
    url: '/device/deviceCheck',
    method: 'put',
    data: data
  })
}

// 删除设备点检
export function delDeviceCheck(djmId) {
  return request({
    url: '/device/deviceCheck/' + djmId,
    method: 'delete'
  })
}

// 导出设备点检
export function exportDeviceCheck(query) {
  return request({
    url: '/device/deviceCheck/export',
    method: 'get',
    params: query
  })
}

// 查询当前点检设备详情
export function listDeviceCheckDetail(djmDjbh) {
  return request({
    url: '/device/deviceCheck/detail/' + djmDjbh,
    method: 'get'
  })
}

// 提交按钮
export function updateSubmitDeviceCheck(djmId) {
  return request({
    url: '/device/deviceCheck/submit/' + djmId,
    method: 'put'
  })
}

// 审核按钮
export function updateSuccessDeviceCheck(djmId) {
  return request({
    url: '/device/deviceCheck/success',
    method: 'put',
    data: {
      djmId: djmId
    }
  })
}

// 撤回按钮
export function updateRevokeDeviceCheck(data) {
  return request({
    url: '/device/deviceCheck/revoke',
    method: 'put',
    data: data
  })
}

// 插入保养详情条例
export function updateDeviceCheckDetail(data) {
  return request({
    url: '/device/deviceCheck/updateDetail',
    method: 'post',
    data: data
  })
}
